package com.cms.controller;

import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import com.cms.constant.CmsConstant;
import com.cms.service.ReportService;

@Controller
public class RunningAccountController extends BaseController{

	 @Autowired
	 private ReportService reportService;
	
	 /***
	  * 
	  * @param req
	  * @param resp
	  * @param map
	  * @return
	  * @throws Exception
	  */
	 @RequestMapping(value="/runningAccount.do")
	 public String enter(HttpServletRequest req,HttpServletResponse resp,ModelMap map)throws Exception
	 {
		 Map<String,Object>param =new HashMap<String, Object>();
		 param.put(CmsConstant.CATALOG_NAME, "RUN_ACCOUNT");
		 map.put("runningAccount", this.reportService.getReportResult(CmsConstant.CATALOG_CODE, param));
		 return "runningAccount/runningAccountMain.html";
	 }
	 
	 
	 /***
	  * 
	  * @param req
	  * @param resp
	  * @param map
	  * @return
	  * @throws Exception
	  */
	 @RequestMapping(value="/runningAccount/pagingRunningAccount.do")
	 public String pagingRunningAccount(HttpServletRequest req,HttpServletResponse resp,ModelMap map)throws Exception
	 {
		 Map<String,Object>param = this.buildQueryMap(req);
		 map.put("runningAccountList", this.reportService.pagingReportResult("paggingRunningAccountList", param));
		 return "runningAccount/runningAccountList.html";
	 }
}
